Encoder, decoder, encoding method, decoding method, and recording medium

ABSTRACT

An encoder includes: a correction unit configured to execute gradation correction on RAW image data from an image capture element having optical black on the basis of a gamma coefficient and an optical black value of the optical black; and an encoding unit configured to encode gradation correction RAW image data that has undergone gradation correction by the correction unit.

CLAIM OF PRIORITY

The present application claims priority from Japanese patent applicationJP 2018-5212 filed on Jan. 16, 2018, the content of which is herebyincorporated by reference into this application.

BACKGROUND

The present invention relates to an encoder, a decoder, an encodingmethod, a decoding method, an encoding program, and a decoding program.

A feature of performing gradation correction on RAW image data has beendisclosed (JP 2006-270478 A). However, if the optical black in theoutput from an image capture element is not zero, then if encoding isperformed with gradation correction by the above-mentioned √γ or thelike being performed in order to mitigate encoding distortion of darkportions, then the degree to which encoding distortion of dark portionsis mitigated by the gradation correction is reduced compared to a casein which the optical black is zero.

SUMMARY

An aspect of the disclosure of an encoder in this application is anencoder, comprising: a correction unit configured to execute gradationcorrection on RAW image data from an image capture element havingoptical black on the basis of a gamma coefficient and an optical blackvalue of the optical black; and an encoding unit configured to encodegradation correction RAW image data that has undergone gradationcorrection by the correction unit.

An aspect of the disclosure of a decoder in this application is adecoder, comprising: an acquisition unit configured to acquire encodedRAW image data resulting from encoding gradation correction RAW imagedata that has undergone gradation correction on the basis of a gammacoefficient and an optical black value; a decoding unit configured todecode the encoded RAW image data acquired by the acquisition unit intothe gradation correction RAW image data; and an inverse gradationcorrection unit configured to execute inverse gradation correction onthe gradation correction RAW image data decoded by the decoding unit onthe basis of the gamma coefficient and the optical black value, andoutput the RAW image data prior to gradation correction.

An aspect of the disclosure of an encoding method in this application isan encoding method, comprising: a correction process of executinggradation correction on RAW image data from an image capture elementhaving optical black on the basis of a gamma coefficient and an opticalblack value of the optical black; and an encoding process of encodinggradation correction RAW image data that has undergone gradationcorrection by the correction process.

An aspect of the disclosure of a decoding method in this application isa decoding method, comprising: an acquisition process of acquiringencoded RAW image data resulting from encoding gradation correction RAWimage data that has undergone gradation correction on the basis of agamma coefficient and an optical black value; a decoding process ofdecoding the encoded RAW image data acquired by the acquisition processinto the gradation correction RAW image data; and an inverse gradationcorrection process of executing inverse gradation correction on thegradation correction RAW image data decoded by the decoding process onthe basis of the gamma coefficient and the optical black value, andoutputting the RAW image data prior to gradation correction.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a hardware configuration example ofthe information processing apparatus.

FIG. 2 is a block diagram showing a mechanical configuration example ofthe encoder according to Embodiment 1.

FIG. 3 is a descriptive drawing showing a data structure example for theencoded gradation correction RAW image data.

FIG. 4 is a block diagram showing a configuration example of theencoding unit.

FIG. 5 is a flowchart showing an example of encoding process steps bythe encoder.

FIG. 6 is a block diagram showing a mechanical configuration example ofthe decoder.

FIG. 7 is a block diagram showing a configuration example of thedecoding unit.

FIG. 8 is a flowchart showing an example of decoding process steps bythe decoder.

FIG. 9 is a graph showing input-output characteristics for gradationcorrection when the optical black value is not used.

FIG. 10 is a graph showing gain characteristics for gradation correctionwhen the optical black value is not used.

FIG. 11 is a graph showing input-output characteristics for inversegradation correction when the optical black value is not used.

FIG. 12 is a graph showing input-output characteristics 1 for gradationcorrection when an optical black value is used.

FIG. 13 is a graph showing gain characteristics under input-opticalcharacteristics 1 for gradation correction when an optical black valueis used.

FIG. 14 is a graph showing input-output characteristics 1 for inversegradation correction when an optical black value is used.

FIG. 15 is a graph showing input-output characteristics 2 for gradationcorrection when an optical black value is used.

FIG. 16 is a graph showing gain characteristics under input-opticalcharacteristics 2 for gradation correction when an optical black valueis used.

FIG. 17 is a graph showing input-output characteristics 2 for inversegradation correction when an optical black value is used.

FIG. 18 is a graph showing input-output characteristics 3 for gradationcorrection when an optical black value is used.

FIG. 19 is a graph showing gain characteristics under input-opticalcharacteristics 3 for gradation correction when an optical black valueis used.

FIG. 20 is a graph showing input-output characteristics 3 for inversegradation correction when an optical black value is used.

FIG. 21 is a graph showing input-output characteristics 4 for gradationcorrection when an optical black value is used.

FIG. 22 is a graph showing gain characteristics under input-opticalcharacteristics 4 for gradation correction when an optical black valueis used.

FIG. 23 is a graph showing input-output characteristics 4 for inversegradation correction when an optical black value is used.

FIG. 24 is a graph showing input-output characteristics 5 for gradationcorrection when an optical black value is used.

FIG. 25 is a graph showing gain characteristics under input-opticalcharacteristics 5 for gradation correction when an optical black valueis used.

FIG. 26 is a graph showing input-output characteristics 5 for inversegradation correction when an optical black value is used.

FIG. 27 is a graph showing input-output characteristics 6 for gradationcorrection when an optical black value is used.

FIG. 28 is a graph showing gain characteristics under input-opticalcharacteristics 6 for gradation correction when an optical black valueis used.

FIG. 29 is a graph showing input-output characteristics 6 for inversegradation correction when an optical black value is used.

FIG. 30 is a graph showing input-output characteristics 7 for gradationcorrection when an optical black value is used.

FIG. 31 is a graph showing gain characteristics under input-opticalcharacteristics 7 for gradation correction when an optical black valueis used.

FIG. 32 is a graph showing input-output characteristics 7 for inversegradation correction when an optical black value is used.

FIG. 33 is a graph showing input-output characteristics 8 for gradationcorrection when an optical black value is used.

FIG. 34 is a graph showing gain characteristics under input-opticalcharacteristics 8 for gradation correction when an optical black valueis used.

FIG. 35 is a graph showing input-output characteristics 8 for inversegradation correction when an optical black value is used.

FIG. 36 is a graph showing input-output characteristics 9 for gradationcorrection when an optical black value is used.

FIG. 37 is a graph showing gain characteristics under input-opticalcharacteristics 9 for gradation correction when an optical black valueis used.

FIG. 38 is a graph showing input-output characteristics 9 for inversegradation correction when an optical black value is used.

EMBODIMENT 1

<Hardware Configuration Example of Information Processing Apparatus>

FIG. 1 is a block diagram showing a hardware configuration example ofthe information processing apparatus. An information processingapparatus 100 is an apparatus including an encoder and/or a decoder. Theinformation processing apparatus 100 may be an imaging apparatus such asa digital camera or a digital video camera, or a personal computer, atablet, a smartphone, or a gaming device, for example.

The information processing apparatus 100 includes a processor 1 01, astorage device 102, an operation device 103, an LSI (Large Scale Integration) 104, an imaging unit 105, and a communication interface (communication IF) 106. These are connected to one another by a bus 108. Theprocessor 101 controls the information processing apparatus 100. Thestorage device 102 serves as a work area of the processor 101.

The storage device 102 is a non-transitory or temporary recording mediumwhich stores the various programs and data. The storage devic e 102 canbe, for example, a read-only memory (ROM), a random access memory (RAM),a hard disk drive (HDD), or a flash memory. The operati on device 103operates data. The operation device 103 can be, for exam ple, a button,a switch, or a touch panel.

An LSI 104 is an integrated circuit that executes specific processesincluding image processes such as color interpolation, contourenhancement, and gamma correction; an encoding process; a decodingprocess; a compression/decompression process; and the like.

An imaging unit 105 captures a subject and generates RAW image data. Theimaging unit 105 has an imaging optical system 151, an image captureelement 153 having a color filter 152, and a signal processing circuit154.

The imaging optical system 151 is constituted of a plurality of lensesincluding a zoom lens and a focus lens, for example. For a simplifiedview, in FIG. 1, one lens is depicted for the imaging optical system151.

The image capture element 153 is a device for capturing an image of asubject using light beams passing through the imaging optical system151. The image capture element 153 may be a sequential scanning typesolid-state image sensor (such as a CCD (charge-coupled device) imagesensor), or may be an X-Y addressing type solid-state image captureelement (such as a CMOS (complementary metal-oxide semiconductor) imagesensor).

On the light-receiving surface of the image capture element 153, a pixelgroup 160 having photoelectric conversion units is arranged in a matrix.For each pixel of the image capture element 153, a plurality of types ofcolor filters 152 that respectively allow through light of differingcolor components are arranged in a prescribed color array. Thus, eachpixel of the image capture element 153 outputs an electrical signalcorresponding to each color component as a result of color separation bythe color filter 152.

In Embodiment 1, for example, red (R), green (G), and blue (B) colorfilters 152 are arranged periodically on the light-receiving surfaceaccording to a Bayer arrangement of two rows by two columns. As anexample, odd-numbered rows of the color array of the image captureelement 153 have G and B pixels arranged alternately, whereaseven-numbered rows of the color array have R and G pixels arrangedalternately. The color array overall has green pixels arranged so as toform a checkered pattern. As a result, the image capture element 153 canacquire RAW image data in color during imaging.

The pixel group 160, in which the pixels are arranged in a 2-dimensionalarray in the image capture element 153, is constituted of an activepixel area 161 and an optical black pixel area 162. The active pixelarea 161 is a pixel area in which a signal charge generated byphotoelectric conversion of actually received light is amplified andoutputted to the signal processing circuit 154.

The optical black pixel area 162 is a pixel area for outputting opticalblack that serves as a reference for the black level. The optical blackpixel area 162 is provided on the outer periphery of the active pixelarea 161, for example. The optical black pixel area 162 is provided inorder to perform subtraction correction of heat noise generated by theimage capture element 153, for example.

The signal processing circuit 154 sequentially executes, on an imagesignal inputted from the image capture element 153, an analog signalprocess (correlated double sampling, black level correction, etc.), anA/D conversion process, and digital signal processing (defective pixelcorrection). The RAW image data outputted from the signal processingcircuit 154 is inputted to the LSI 104 or a storage device 102. Acommunication I/F 106 connects to an external device via the network andtransmits/receives data.

<Mechanical Configuration Example of Encoder>

FIG. 2 is a block diagram showing a mechanical configuration example ofthe encoder according to Embodiment 1. The encoder 200 has a gradationcorrection unit 201, an encoding unit 202, a recording unit 203, and asetting unit 204. The gradation correction unit 201, the encoding unit202, the recording unit 203, and the setting unit 204 are specificallyfunctions realized by the LSI 104, or by the processor 101 executingprograms stored in the storage device 102, for example.

The gradation correction unit 201 performs gradation correction on theRAW image data. The RAW image data is image data of pixel values thatare in a linear relationship with the intensity of light from the imagecapture element 153, which performs photoelectric conversion of lightfrom the subject attained via the color filters 152. In other words, theRAW image data is image data that has not been subjected to imageprocessing such as gamma correction, demosaicing, white balanceadjustment, or color conversion. The data volume of the RAW image datais large compared to data on which the above-mentioned image processesand the encoding process (compression process) has been performed. TheRAW image data may be a still image or one frame of a video.

The gradation correction unit 201 performs gradation correction on theRAW image data from the image capture element 153 having the opticalblack pixel area 162 on the basis of the value of the gamma coefficient(gamma value) and the optical black value. For example, the gradationcorrection unit 201 executes gradation correction by √γ or the like onthe RAW image data according to the optical black value. The gradationcorrection unit 201 executes a noise reduction process (NR process) whenperforming gradation correction. Details regarding the gradationcorrection by the gradation correction unit 201 will be described later.

The encoding unit 202 encodes the RAW image data that has undergonegradation correction by the gradation correction unit 201 (hereinafterreferred to as gradation correction RAW image data) and outputs encodedgradation correction RAW image data. If the gradation correction RAWimage data is a still image, the encoding unit 202 performs in-frameencoding to encode the gradation correction RAW image data into anI-picture.

If the gradation correction RAW image data is one frame of a video, theencoding unit 202 employs in-frame predictive encoding to encode thegradation correction RAW image data into an I-picture, or employsinter-frame predictive encoding with reference to other gradationcorrection RAW image data to encode the gradation correction RAW imagedata into a P-picture or a B-picture.

If the optical black value in the output from the image capture element153 is not zero, then if gradation correction by √γ or the like wereperformed as is in order to mitigate encoding distortion of darkportions, then the degree to which encoding distortion of the darkportions is mitigated by gradation correction is small compared to ifthe optical black value is zero. The encoding unit 202 executesgradation correction by √γ or the like based on the optical black value,and adds the γ value used during decoding/playback to the headerinformation of the encoded gradation correction RAW image data andapplies the optical black value thereto. As a result, it is possible toeliminate a decrease in the degree to which encoding distortion of blackportions by gradation correction is mitigated.

The recording unit 203 records the encoded gradation correction RAWimage data in the storage device 102. The setting unit 204 sets thegamma coefficient value, the calculated provisional gain, and theexposure value and outputs these values to the gradation correction unit201. Details regarding the setting unit 204 will be described inEmbodiments 3 and 4.

<Data Structure Example of Gradation Correction RAW Image Data>

FIG. 3 is a descriptive drawing showing a data structure example for theencoded gradation correction RAW image data. The encoded gradationcorrection RAW image data 300 has header information 301 and an encodeddata array 302. The header information 301 is information added by theencoding unit 202. The header information 301 includes image formatinformation 311 and control information 312. The encoded data array 302is a data array in which the gradation correction RAW image data isencoded.

Elements of the header information 301 will be described in detailbelow. The image format information 311 includes the size of thegradation correction RAW image data prior to encoding, the size of theencoded gradation correction RAW image data, identification informationspecifying the color array pattern, and the pixel count of the gradationcorrection RAW image data prior to encoding.

The control information 312 includes a gamma value 321 for whengradation correction is performed, an optical black value 322 thatserves as a reference for the black level, a calculated provisional gain323, a first pouch width 324, a second pouch width 325, and a gradationcorrection identifier 326, in addition to the type of encoded gradationcorrection RAW image data (I-picture, P-picture, or B-picture) andidentification information of the reference frame.

The calculated provisional gain 323 will be described in Embodiments 3and 4. The first pouch width 324 and the second pouch width 325 will bedescribed in Embodiment 4. The gradation correction identifier 326 is anidentifier for identifying the algorithm that executes gradationcorrection. With the gradation correction identifier 326, the decodercan identify which algorithm was used to perform gradation correction onthe encoded gradation correction RAW image data 300.

<Configuration Example of Encoding Unit 202>

FIG. 4 is a block diagram showing a configuration example of theencoding unit 202. The encoding unit 202 has a first accumulation unit401, a subtraction unit 402, an orthogonal transformation unit 403, aquantization unit 404, a variable-length coding unit 405, an inversequantization unit 406, an inverse orthogonal transformation unit 407, anaddition unit 408, a second accumulation unit 409, a motion detectionunit 410, and a motion compensation unit 411.

The first accumulation unit 401 accumulates the gradation correction RAWimage data outputted from the gradation correction unit 201. Thegradation correction RAW image data accumulated in the firstaccumulation unit 401 is outputted to the subtraction unit 402 as imagedata to be encoded in the order that the gradation correction RAW imagedata was inputted. The gradation correction RAW image data that has beenencoded is sequentially deleted from the first accumulation unit 401.

When generating the P-picture or the B-picture, the subtraction unit 402outputs a difference signal (prediction error value) between a componentframe of the inputted original image (gradation correction RAW imagedata) and a prediction value generated by the motion compensation unit411 to be described later. Also, when generating the I-picture, thesubtraction unit 402 outputs the component frame of the inputtedoriginal image as is.

When generating the I-picture, the orthogonal transformation unit 403performs orthogonal transformation on the original image inputted afterpassing through the subtraction unit 402 without modification. Also,when generating the P-picture or the B-picture, the orthogonaltransformation unit 403 performs orthogonal transformation on theabove-mentioned difference signal.

The quantization unit 404 converts the frequency coefficient (orthogonaltransformation coefficient) for each block inputted from the orthogonaltransformation unit 403 into a quantization coefficient. The output fromthe quantization unit 404 is inputted to the variable-length coding unit405 and the inverse quantization unit 406.

The variable-length coding unit 405 performs variable-length coding of amotion vector from the motion detection unit 410 and outputs the encodedgradation correction RAW image data (I-picture, P-picture, B-picture).

The inverse quantization unit 406 performs inverse quantization on aquantized coefficient at the block level, which is the level at whichencoding is performed, to decode the frequency coefficient. The inverseorthogonal transformation unit 407 performs inverse orthogonaltransformation on the frequency coefficient decoded by the inversequantization unit 406 to decode the prediction error value (or originalimage).

The addition unit 408 adds the decoded prediction error value to aprediction value (to be mentioned later) generated by the motioncompensation unit 411. Decoded values (reference frames) of the pictureoutputted from the addition unit 408 are accumulated in the secondaccumulation unit 409. Reference frames not referred to in motioncompensation prediction thereafter are sequentially deleted from thesecond accumulation unit 409.

The motion detection unit 410 uses the reference frames of the secondaccumulation unit 409 to detect the motion vector for predicting thegradation correction RAW image data to be encoded. The motion vector isoutputted to the motion compensation unit 411 and the variable-lengthcoding unit 405.

The motion compensation unit 411 outputs the prediction values predictedat the block level for the gradation correction RAW image data to beencoded on the basis of the motion vector and the reference frame. Theprediction values are outputted to the subtraction unit 402 and theaddition unit 408.

If motion compensation prediction is to be performed for a given block,when the gradation correction RAW image data to be encoded completelymatches the prediction values, only the motion vector is encoded. If thegradation correction RAW image data to be encoded partially matches theprediction values, the motion vector and a difference image are encoded.If none of the gradation correction RAW image data to be encoded matchesthe prediction values, the image for the entire block is encoded.

<Example of Encoding Process Steps>

FIG. 5 is a flowchart showing an example of encoding process steps bythe encoder 200. The encoder 200 receives input of the RAW image dataoutputted from the image capture element 153 having the optical blackpixel area 162 (step S501), and the gradation correction unit 201 uses agradation correction algorithm to perform gradation correction on theRAW image data (step S502).

Next, the encoder 200 uses the encoding unit 202 to encode the gradationcorrection RAW image data (step S503). Then, the encoder 200 uses therecording unit 203 to store the encoded gradation correction RAW imagedata 300 in the storage device 102 (step S504).

<Mechanical Configuration Example of Decoder>

FIG. 6 is a block diagram showing a mechanical configuration example ofthe decoder. The decoder 600 has an acquisition unit 601, a decodingunit 602, and an inverse gradation correction unit 603. The acquisitionunit 601, the decoding unit 602, and the inverse gradation correctionunit 603 are specifically functions realized by the LSI 104, or by theprocessor 101 executing programs stored in the storage device 102, forexample.

The acquisition unit 601 acquires the encoded gradation correction RAWimage data 300 encoded by the encoder 200. If the decoder 600 and theencoder 200 can communicate with each other, then the acquisition unit601 receives the encoded gradation correction RAW image data 300transmitted from the encoder 200. If the decoder 600 and the encoder 200are installed in the same device, then the acquisition unit 601 readsthe encoded gradation correction RAW image data 300 stored in thestorage device 102.

The decoding unit 602 decodes the encoded gradation correction RAW imagedata 300 to the gradation correction RAW image data using the controlinformation 312. Specifically, for example, the decoding unit identifiesthe reference frame according to the type of encoded gradationcorrection RAW image data 300 (I-picture, P-picture, B-picture) anddecodes the encoded gradation correction RAW image data 300 to thegradation correction RAW image data.

The inverse gradation correction unit 603 performs inverse gradationcorrection on the gradation correction RAW image data decoded by thedecoding unit 602 to restore the RAW image data prior to gradationcorrection. Specifically, for example, the inverse gradation correctionunit 603 refers to the gradation correction identifier 326 of thecontrol information 312 to identify the gradation correction algorithmapplied to the RAW image data, and executes an inverse gradationcorrection algorithm corresponding to the identified gradationcorrection algorithm. The inverse gradation correction unit 603 executesa noise reduction process (NR process) when performing inverse gradationcorrection.

<Configuration Example of Decoding Unit 602>

FIG. 7 is a block diagram showing a configuration example of thedecoding unit 602. The decoding unit 602 has a variable-length codedecoding unit 701, an inverse quantization unit 702, an inverseorthogonal transformation unit 703, an addition unit 704, a thirdaccumulation unit 705, and a motion detection unit 706.

The variable-length code decoding unit 701 decodes the inputted encodedgradation correction RAW image data 300 and outputs a quantizationcoefficient and a motion vector. The decoded quantization coefficient isinputted to the inverse quantization unit 702 and the decoded motionvector is inputted to the motion compensation unit 706.

The inverse quantization unit 702 performs inverse quantization on aquantized coefficient at the block level to decode the frequencycoefficient. The inverse orthogonal transformation unit 703 performsinverse orthogonal transformation on the frequency coefficient decodedby the inverse quantization unit 702 to decode the prediction errorvalue (or signal of original image).

The addition unit 704 adds the decoded prediction error value to aprediction value generated by the motion compensation unit 706, therebyoutputting the decoded image data at the block level. The image dataoutputted from the addition unit 704 is outputted as the gradationcorrection RAW image data and inputted to the third accumulation unit705.

The third accumulation unit 705 accumulates the decoded value of theimage as the reference frame. Image data not referred to in motioncompensation prediction thereafter is sequentially deleted from thethird accumulation unit 705. The motion compensation unit 706 outputs,to the addition unit 704, the prediction values predicted at the blocklevel for the image to be decoded on the basis of the motion vector andthe reference frame.

<Example of Decoding Process Steps>

FIG. 8 is a flowchart showing an example of decoding process steps bythe decoder 600. The decoder 600 uses the acquisition unit 601 toacquire the encoded gradation correction RAW image data 300 (step S801),and uses the decoding unit 602 to decode the encoded gradationcorrection RAW image data 300 to the gradation correction RAW image data(step S2102). Then, the decoder 600 uses the inverse gradationcorrection unit 603 to perform inverse gradation correction on thedecoded gradation correction RAW image data to restore the RAW imagedata (step S803).

<Specific Example of Gradation Correction and Inverse GradationCorrection>

Next, specific examples of gradation correction by the gradationcorrection unit 201 and inverse gradation correction by the inversegradation correction unit 603 according to Embodiment 1 will bedescribed with reference to FIGS. 9 to 17. For comparison withEmbodiment 1, gradation correction and inverse gradation correction inwhich an optical black value is not used are indicated in the graphs ofFIGS. 9 to 11, gradation correction 1 and inverse gradation correction 1of Embodiment 1 are indicated in FIGS. 12 to 14, and gradationcorrection 2 and inverse gradation correction 2 of Embodiment 1 areindicated in FIGS. 15 to 17.

(Characteristics of Gradation Correction when Optical Black Value is NotUsed)

FIG. 9 is a graph showing input-output characteristics for gradationcorrection when the optical black value is not used. The horizontal axisindicates the signal level (input signal level E) for the RAW image datafrom the image capture element 153, and the vertical axis indicates thesignal level (output signal level E′) for the gradation correction RAWimage data. This similarly applies to FIGS. 12, 15, 18, 21, and 24.However, the input signal level E of FIG. 9 is the signal level for RAWimage data from an image capture element 153 that does not have theoptical black pixel area 162.

Also, the signal level is a voltage indicating the luminance of pixelsin the active pixel area 161, for example, and is normalized to within arange of 0.0 to 1.0. Pixels with a low signal level are dark pixels andpixels with a high signal level are bright pixels. OB (optical black)indicates the optical black value.

The gradation correction algorithm shown in the input-outputcharacteristic curve 900 of FIG. 9 is represented by the followingformula (1).

E′=OETF[E]=E ^(1/γ)  (1)

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, and γ is the gamma value.

In the input-output characteristic curve 900, gradation correction isexecuted for an interval SC9 from an input signal level of 0.0 to theoptical black value OB. When encoding the RAW image data, both dark andbright portions are subjected to equivalent encoding, and thus, if gammacorrection is performed at the developing stage, then the dark portionsare emphasized, and the higher the compression rate is, the moreapparent the encoding distortion is.

FIG. 10 is a graph showing gain characteristics for gradation correctionwhen the optical black value is not used. The gain is the degree ofemphasis of the input signal level E. A gain characteristic curve 1000for gradation correction when the optical black value is not used isrepresented by the following formula (2), which is the derivative offormula (1).

G={OETF[E]}′=(1/γ)×E ^({(1/γ)−1})  (2)

G is the gain of the input signal level E. In the gain characteristiccurve 1000, the value of the gain G for the interval SC9 from an inputsignal level E of 0.0 to the optical black value OB is greater than thevalue of the gain G for the optical black value OB. In other words, thegain of the pixels is large for the interval SC9 in which the value ofthe input signal level E, which is inactive after developing, is from0.0 to the optical black value OB. Thus, the gain in the interval ofgreater than or equal to the optical black value OB, which is active forthe image after developing, has a low gain and a lesser effect ofmitigating encoding distortion.

FIG. 11 is a graph showing input-output characteristics for inversegradation correction when the optical black value is not used. Thehorizontal axis indicates the signal level (input signal level E′) forthe gradation correction RAW image data, and the vertical axis indicatesthe signal level (output signal level E) for the RAW image data that hasundergone inverse gradation correction from the gradation correction RAWimage data.

This similarly applies to FIGS. 14, 17, 20, 23, and 26. However, theoutput signal level E of FIG. 11 is the signal level for RAW image data,which was restored by inverse gradation correction, from an imagecapture element 153 that does not have the optical black pixel area 162.Also, similar to FIG. 9, the signal level is a voltage indicating theluminance of pixels in the active pixel area 161, for example, and isnormalized to within a range of 0.0 to 1.0. Pixels with a low signallevel are dark pixels and pixels with a high signal level are brightpixels.

The inverse gradation correction algorithm shown in the input-outputcharacteristic curve 1100 of FIG. 11 is represented by the followingformula (3).

E=EOTF[E′]=E ^(γ)  (3)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), EOTF[ ] represents an inversegradation correction function, and y is the gamma value.

(Characteristic Example 1 of Gradation Correction when Optical BlackValue is Used)

Next, with reference to FIGS. 12 to 14, a characteristic example 1 ofgradation correction for when the optical black value is used will bedescribed.

FIG. 12 is a graph showing input-output characteristics 1 for gradationcorrection when an optical black value is used. In the input-outputcharacteristic curve 1200, the gradation correction unit 201 does notexecute gradation correction for an input signal level E lower than theoptical black value OB. In other words, in the input-outputcharacteristic curve 1200 of FIG. 12, the output signal level E′ is 0.0for the interval SC9 from when the input signal level E is at 0.0 to theoptical black value OB and rises from when the input signal level E isat the optical black value OB, and the output signal level E′ reachesthe maximum value when the input signal level E is at 1.0.

The gradation correction algorithm shown in the input-outputcharacteristic curve 1200 of FIG. 12 is represented by the followingformula (4).

E′=OETF[E]=0 E<OB

(E−OB)^(1/γ) OB≤E   (4)

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, and γ is the gammavalue. The gradation correction unit 201 outputs the gradationcorrection identifier 326 indicating the gradation correction algorithmof formula (4) to the encoding unit 202, and the encoding unit 202 usesthe gradation correction identifier 326 from the gradation correctionunit 201 as the control information 312 in the header information 301.

FIG. 13 is a graph showing gain characteristics under input-opticalcharacteristics 1 for gradation correction when an optical black valueis used. A gain characteristic curve 1300 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (5), which is the derivative of formula (4).

G={OETF[E]}′=0 E<OB

(1/γ)×(E−OB)^({(1/γ)−1}) OB≤E   (5)

G is the gain of the input signal level E. In the gain characteristiccurve 1300, the value of the gain G for the interval from an inputsignal level E of 0.0 to the optical black value OB is 0.0, and thus,the input signal level E in the interval SC9 from 0.0 to the opticalblack value OB, which is the dark portion, is not emphasized. Also, thevalue of the gain G reaches the maximum value at the optical black valueOB, and thus, by setting at a high value the gain in the interval ofgreater than or equal to the optical black value OB, which is active forthe image after developing, it is possible to achieve a greater effectof mitigating encoding distortion.

During developing or image adjustment, there are cases in which darkportions should be brightened to allow for greater visibility of figuresin dark portions or the like. At this time, distortion of dark portionsoccurring between the encoding unit 202 and the decoding unit 602 has atendency to become prominent. By setting the gain G of the dark portionto be large during gradation correction, distortion of dark portionsoccurring between the encoding unit 202 and the decoding unit 602 can besuppressed. As a result, during developing or image adjustment, even ifdark portions are brightened to allow for greater visibility of figuresin dark portions or the like, distortion of dark portions has less of atendency to be prominent.

FIG. 14 is a graph showing input-output characteristics 1 for inversegradation correction when an optical black value is used. The inversegradation correction algorithm shown in the input-output characteristiccurve 1400 of FIG. 14 is represented by the following formula (6).

E=EOTF[E′]=(E′)^(γ) +OB   (6)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. The inverse gradation correction unit 603executes the inverse gradation correction of formula (6) if thegradation correction identifier 326 indicating formula (4) is detectedin the control information 312.

In the input-output characteristic curve 1400, the restored RAW imagedata has the optical black value OB as the minimum value for the outputsignal level E, and thus, by setting at a high value the gain in theinterval of greater than or equal to the optical black value OB, whichis active for the image after developing, it is possible to achieve agreater effect of mitigating encoding distortion.

(Characteristic Example 2 of Gradation Correction when Optical BlackValue is Used)

Next, with reference to FIGS. 15 to 17, a characteristic example 2 ofgradation correction for when the optical black value is used will bedescribed. In characteristic example 1 for gradation correction for whenthe optical black value OB is used, no restoration occurs in theinterval SC12, which is the bright portion of the output signal levelE′, in the input-output characteristic curve 1200 of FIG. 12. Incharacteristic example 2 of gradation correction for when the opticalblack value OB is used, the reproducibility of bright portions isimproved while mitigating black level degradation with a highreproducibility of the original black as in characteristic example 1 ofgradation correction for when the optical black value OB is used.

FIG. 15 is a graph showing input-output characteristics 2 for gradationcorrection when an optical black value is used. In the input-outputcharacteristic example 2 for gradation correction when using the opticalblack value OB, similar to the input-output characteristic example 1 forgradation correction when using the optical black value OB, thegradation correction unit 201 does not execute gradation correction foran input signal level E lower than the optical black value OB.

In other words, in the input-output characteristic curve 1500 of FIG.15, the output signal level E′ is 0.0 for the interval SC9 from when theinput signal level E is at 0.0 to the optical black value and rises fromwhen the input signal level E is at the optical black value OB, and theoutput signal level E′ reaches the upper limit of 1.0 when the inputsignal level E is at 1.0.

The gradation correction algorithm shown in the input-outputcharacteristic curve 1500 of FIG. 15 is represented by the followingformula (7).

E′=OETF[E]=0 E<OB

{(E−OB)/(1−OB)}^(1/γ) OB≤E   (7)

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, and γ is the gammavalue. The gradation correction unit 201 outputs the gradationcorrection identifier 326 indicating the gradation correction algorithmof formula (7) to the encoding unit 202, and the encoding unit 202 usesthe gradation correction identifier 326 from the gradation correctionunit 201 as the control information 312 in the header information 301.

Thus, by setting the maximum value for the output signal level E′ to1.0, it is possible to improve color reproduction in the bright portionsas compared to the input-output characteristic curve 1200.

FIG. 16 is a graph showing gain characteristics under input-opticalcharacteristics 2 for gradation correction when an optical black valueis used. A gain characteristic curve 1600 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (8), which is the derivative of formula (7).

G={OETF[E]}′=0 E<OB

(1/γ)×{(E−OB)/(1−OB)}^((1/γ)−1) OB≤E   (8)

G is the gain of the input signal level E. The value of the gain G forthe interval SC9 from an input signal level E of 0.0 to the opticalblack value OB is 0.0, and thus, the input signal level E in theinterval SC9 from 0.0 to the optical black value OB, which is the darkportion, is not emphasized. Also, the value of the gain G reaches themaximum value (infinity) at the optical black value OB, and thus, bysetting at a high value the gain in the interval of greater than orequal to the optical black value OB, which is active for the image afterdeveloping, it is possible to achieve a greater effect of mitigatingencoding distortion.

Similar to the input-output characteristic example 1 for gradationcorrection when using the optical black value, by setting the gain G ofthe dark portion to be large during gradation correction, distortion ofdark portions occurring between the encoding unit 202 and the decodingunit 602 can be suppressed. As a result, during developing or imageadjustment, even if dark portions are brightened to allow for greatervisibility of figures in dark portions or the like, distortion of darkportions has less of a tendency to be prominent.

FIG. 17 is a graph showing input-output characteristics 2 for inversegradation correction when an optical black value is used. The inversegradation correction algorithm shown in the input-output characteristiccurve 1700 of FIG. 17 is represented by the following formula (9).

E=EOTF[E′]=(1−OB)×(E′)^(γ) +OB   (9)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. The inverse gradation correction unit 603executes the inverse gradation correction of formula (9) if thegradation correction identifier 326 indicating formula (7) is detectedin the control information 312.

Similar to the input-output characteristic example 1 of gradationcorrection when using the optical black value OB, the restored RAW imagedata has the optical black value OB as the minimum value for the outputsignal level E, and thus, the color of the pixel in the interval SC11where the output signal level E is from 0.0 to the optical black valueOB is not reproduced, and by setting at a high value the gain in theinterval of greater than or equal to the optical black value OB, whichis active for the image after developing, it is possible to achieve agreater effect of mitigating encoding distortion.

Also, the input-output characteristic curve 1700 of FIG. 17, unlike theinput-output characteristic curve 1400 of FIG. 14, does not have theinterval SC14 where the input signal level E′ is not present. In otherwords, in the input-output characteristic example 2 for gradationcorrection when using the optical black value OB, it is possible toimprove color reproduction for pixels in the bright portions.

Embodiment 2

Embodiment 2 is an example in which an input signal level E less than orequal to the optical black value OB is replicated while the gain G ofthe optical black value OB is maximized in the manner of theinput-output characteristic example 2 of gradation correction for whenthe optical black value of Embodiment 1 is used. In Embodiment 2,differences from Embodiment 1 will be primarily described, anddescriptions of the same configurations and content as Embodiment 1 areapplicable to Embodiment 2 as well, and descriptions thereof areomitted.

FIG. 18 is a graph showing input-output characteristics 3 for gradationcorrection when an optical black value is used. In the input-outputcharacteristic example 3 for gradation correction when using the opticalblack value, unlike the input-output characteristic examples 1 and 2 ofgradation correction when using the optical black value, the gradationcorrection unit 201 executes negative gradation correction for inputsignal levels E lower than the optical black value OB, or in otherwords, executes negative 1/γ correction, and executes positive gradationcorrection for input signal levels E greater than or equal to theoptical black value OB, or in other words, executes positive 1/γcorrection.

Specifically, for example, in the input-output characteristic curve1800, a waveform 1801 in the interval SC9 is a waveform attained fromnegative 1/γ correction, and a waveform 1802 of the interval greaterthan or equal to the optical black value OB is a waveform attained frompositive 1/γ correction.

The gradation correction algorithm shown in the input-outputcharacteristic curve 1800 of FIG. 18 is represented by the followingformula (10).

E′=OETF[E]=−α×{(OB−E)/(1−OB)}^(1/γ) +β E<OB

α×{(E−OB)/(1−OB)}^(1/γ) +β OB≤E   (10)

where α=1/{1+{OB/(1−OB)}^(1/γ)}

β=α×{OB/(1−OB)}^(1/γ)

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, and y is the gammavalue.

In formula (10), the formula for when the condition is E<OB is theformula for negative 1/γ correction, and the formula for when thecondition is OB≤E is the formula for positive 1/γ correction. Thegradation correction unit 201 outputs the gradation correctionidentifier 326 indicating the gradation correction algorithm of formula(10) to the encoding unit 202, and the encoding unit 202 uses thegradation correction identifier 326 from the gradation correction unit201 as the control information 312 in the header information 301.

By executing negative 1/γ correction in the interval SC9, it is possibleto improve color reproduction in the vicinity of the optical black valueOB in the RAW image data that has undergone gradation correction. Inother words, in the portion of the input-output characteristic curve1800 in the vicinity of the optical black value OB, noise on the sidewhere the input signal level E is less than the optical black value OB(negative direction) and noise on the side where the input signal levelE is greater than the optical black value OB (positive direction) canceleach other out in a noise reduction process, which allows for moreefficient noise reduction than in Embodiment 1. Thus, it is possible tomitigate black level degradation in the vicinity of the optical blackvalue OB in the RAW image data that has undergone gradation correction,and improve color reproduction.

FIG. 19 is a graph showing gain characteristics under input-opticalcharacteristics 3 for gradation correction when an optical black valueis used. A gain characteristic curve 1900 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (11), which is the derivative of formula (10).

G={OETF[E]}′=(α/γ)×{(OB−E)/(1−OB)}^((1/γ)−1) E<OB

(α/γ)×{(E−OB)/(1−OB)}^((1/γ)−1) OB≤E   (11)

G is the gain of the input signal level E. Specifically, in the gaincharacteristic curve 1900, for example, the gain G takes on the minimumvalue when the input signal level E is at 0.0 in the interval SC9,increases from 0.0, and reaches the maximum value (infinity) when theinput signal level E reaches the optical black value OB.

An interval SC19 is an interval from the optical black value OB to avalue 20B for the input signal level E, which is double the opticalblack value OB. In the interval SC19, the gain G takes on the maximumvalue (infinity) where the input signal level E is at the optical blackvalue OB, and is reduced from the optical black value OB, reaching theminimum value at 20B. In other words, the waveform 1901 indicating thegain characteristics in the interval SC9 and the waveform 1902indicating the gain characteristics in the interval SC19 are in linearsymmetry about the optical black value OB.

As a result, the optical black value OB is the maximum value for thegain G in the interval SC9 and the interval SC19, which are darkportions. Also, the gain G attenuates, the farther the input signallevel E is from the optical black value OB in the interval SC9 and theinterval SC19. Thus, by setting at a high value the gain in the intervalof greater than or equal to the optical black value OB, which is activefor the image after developing, it is possible to achieve a greatereffect of mitigating encoding distortion as well as reducing noiseoccurring in the dark portions.

Also, the waveforms 1901 and 1902 are in linear symmetry about theoptical black value OB, and thus, in the vicinity of the optical blackvalue OB, noise on the side where the input signal level E is less thanthe optical black value OB (negative direction) and noise on the sidewhere the input signal level E is greater than the optical black valueOB (positive direction) cancel each other out to reduce noise, and thus,it is possible to mitigate black level degradation.

Also, similar to Embodiment 1, by setting the gain G of the dark portionto be large during gradation correction, distortion of dark portionsoccurring between the encoding unit 202 and the decoding unit 602 can besuppressed. As a result, during developing or image adjustment, even ifdark portions are brightened to allow for greater visibility of figuresin dark portions or the like, distortion of dark portions has less of atendency to be prominent.

FIG. 20 is a graph showing input-output characteristics 3 for inversegradation correction when an optical black value is used. The inversegradation correction unit 603 executes positive inverse gradationcorrection for a value greater than or equal to β for a given inputsignal level E′ of the gradation correction RAW image data, or in otherwords, executes positive γ correction, and executes negative inversegradation correction for input signal levels less than β, or in otherwords, executes negative γ correction.

An interval SC201 is an interval where the input signal level E′ is from0.0 to β indicated in formula (10), and an interval SC202 is an intervalwhere the input signal level E′ is from β to 1.0. Specifically, forexample, in the input-output characteristic curve 2000, a waveform 2001in the interval SC201 is a waveform attained from negative γ correction,and a waveform 2002 of the interval SC202 is a waveform attained frompositive γ correction.

The inverse gradation correction algorithm shown in the input-outputcharacteristic curve 2000 of FIG. 20 is represented by the followingformula (12).

E=EOTF[E′]=OB−(1−OB)×{(E′−β)/α}^(γ) E′<β

OB+(1−OB)×{(E′−β)/α}^(γ) β/≤E′  (12)

where α=1/{1+{OB/(1−OB)}^(1/γ)}

β=α×{OB/(1−OB)}^(1/γ)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. In formula (12), the formula for when thecondition is E′<β is the formula for negative γ correction, and theformula for when the condition is β≤E′ is the formula for positive γcorrection. The inverse gradation correction unit 603 executes theinverse gradation correction of formula (12) if the gradation correctionidentifier 326 indicating formula (10) is detected in the controlinformation 312.

By executing negative γ correction in the interval SC201, it is possibleto increase the effect of mitigating encoding distortion in the vicinityof the optical black value OB in the restored RAW image data that hasundergone inverse gradation correction, and it is possible to reducenoise occurring in the dark portions, and thus, it is possible toimprove color reproduction.

Embodiment 3

Embodiment 3 is an example in which the gain of dark portions isincreased as compared to Embodiment 2. In Embodiment 3, differences fromEmbodiment 2 will be primarily described, and descriptions of the sameconfigurations and content as Embodiment 2 are applied to Embodiment 3as well, and descriptions thereof are omitted.

FIG. 21 is a graph showing input-output characteristics 4 for gradationcorrection when an optical black value is used. In the input-outputcharacteristic example 4 of gradation correction when using the opticalblack value, the gradation correction unit 201 executes negativegradation correction for input signal levels E lower than the opticalblack value OB, or in other words, executes negative offset 1/γcorrection, and executes positive gradation correction for input signallevels E greater than or equal to the optical black value OB, or inother words, executes positive offset 1/γ correction.

Specifically, for example, in the input-output characteristic curve2100, a waveform 2101 in the interval SC9 is a waveform attained fromnegative offset 1/γ correction, and a waveform 2102 of the intervalgreater than or equal to the optical black value OB is a waveformattained from positive offset 1/γ correction.

The gradation correction algorithm shown in the input-outputcharacteristic curve 2100 of FIG. 21 is represented by the followingformula (13).

E′=OETF[E]=OUT[1]−C×{(OB−E+K)^(1/γ) −K ^(1/γ) } E<OB

OUT[1]+C×{(E−OB+K)^(1/γ) −K ^(1/γ) } OB≤E   (13)

where K=(g×γ)^(γ/(1−γ))

C=1/{(OB+K)^(1/γ)+(1−OB+K)^(1/γ)−2K ^(1/γ)}

OUT[1]=C×{(OB+K)^(1/γ) −K ^(1/γ)}

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, γ is the gammavalue, and g is the calculated provisional gain. In formula (13), theformula for when the condition is E<OB is the formula for negativeoffset 1/γ correction, and the formula for when the condition is OB≤E isthe formula for positive offset 1/γ correction. The gradation correctionunit 201 outputs the gradation correction identifier 326 indicating thegradation correction algorithm of formula (13) to the encoding unit 202,and the encoding unit 202 uses the gradation correction identifier 326from the gradation correction unit 201 as the control information 312 inthe header information 301.

FIG. 22 is a graph showing gain characteristics under input-opticalcharacteristics 4 for gradation correction when an optical black valueis used. A gain characteristic curve 2200 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (14), which is the derivative of formula (13).

G={OETF[E]}′=(C/γ)×(OB−E+K)^((1/γ)−1) E<OB

(C/γ)×(E−OB+K)^((1/γ)−1) OB≤E   (14)

G is the gain of the input signal level E. Specifically, in the gaincharacteristic curve 2200, for example, the gain G takes on the minimumvalue when the input signal level E is at 0.0 in the interval SC9,increases from 0.0, and reaches the calculated provisional gain g, whichis the maximum value, when the input signal level E reaches the opticalblack value OB. The calculated provisional gain is a value set by thesetting unit 204.

In the interval SC19, the gain G takes on the calculated provisionalgain g, which is the maximum value, where the input signal level E is atthe optical black value OB, and is reduced from the optical black valueOB, reaching the minimum value at 20B. In other words, the waveform 2201indicating the gain characteristics in the interval SC9 and the waveform2202 indicating the gain characteristics in the interval SC19 are inlinear symmetry about the optical black value OB.

Also, by offsetting the value of the gain G in the optical black valueOB to the calculated provisional gain g from infinity, as described inEmbodiment 2, the gain characteristic curve 2200 has a higher inputsignal level for the bright portion as compared to the gaincharacteristic curve 1900. Thus, it is possible to emphasize pixels inthe vicinity of the optical black value OB by gradation correction andemphasize pixels in the bright portion.

FIG. 23 is a graph showing input-output characteristics 4 for inversegradation correction when an optical black value is used. The inversegradation correction unit 603 executes positive inverse gradationcorrection for values of OUT[1] or greater for a given input signallevel E′ of the gradation correction RAW image data, or in other words,executes positive offset γ correction, and executes negative gradationcorrection for input signal levels lower than OUT[1], or in other words,executes negative offset γ correction.

An interval SC231 is an interval where the input signal level E′ is from0.0 to OUT[1] indicated in formula (13), and an interval SC232 is aninterval where the input signal level E′ is from OUT[1] to 1.0.Specifically, for example, in the input-output characteristic curve2300, a waveform 2301 in the interval SC231 is a waveform attained fromnegative offset γ correction, and a waveform 2302 of the interval SC232is a waveform attained from positive offset γ correction.

The inverse gradation correction algorithm shown in the input-outputcharacteristic curve 2300 of FIG. 23 is represented by the followingformula (15).

E=EOTF[E′]=OB+K−{(OUT[1]−E′)/C+K ^(1/γ)}^(γ) E′<OUT[1]

OB−K+{(E′−OUT[1])/C+K ^(1/γ)}^(γ) OUT[1]≤E′  (15)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. In formula (15), the formula for when thecondition is E′<OUT[1] is the formula for negative offset γ correction,and the formula for when the condition is OUT[1]≤E′ is the formula forpositive offset γ correction. The inverse gradation correction unit 603executes the inverse gradation correction of formula (15) if thegradation correction identifier 326 indicating formula (13) is detectedin the control information 312.

By executing negative offset 1/γ correction in the interval SC231, it ispossible to improve color reproduction in the vicinity of the opticalblack value OB in the RAW image data that has undergone inversegradation correction. Also, the gain of the bright portions isincreased, and thus, it is possible to emphasize pixels that are in thebright portion as a result of gradation correction.

Additionally, the setting unit 204 may set a calculated gain GOB in theinverse gradation correction unit 603 instead of the calculatedprovisional gain g (formula (16) below). By setting the calculated gainGOB in the inverse gradation correction unit 603, it is possible toimprove the reproducibility of bright portions or optical blackportions, which are dark portions, in the original RAW image data as aresult of inverse gradation correction.

G _(OB) =C×g   (16)

Embodiment 4

Embodiment 4 is an example in which an input signal level E of a givenwidth including an optical black value is provided in the calculatedprovisional gain g of Embodiment 3. In Embodiment 4, differences fromEmbodiment 3 will be primarily described, and descriptions of the sameconfigurations and content as Embodiment 3 are applicable to Embodiment4 as well, and descriptions thereof are omitted.

FIG. 24 is a graph showing input-output characteristics 5 for gradationcorrection when an optical black value is used. In an input-outputcharacteristic example 5 for gradation correction when using an opticalblack value, a given pouch width D including the optical black value OBis set by the setting unit 204. The same gain G is set for the inputsignal level E with a pouch width D.

The range within the pouch width D where the value of the input signallevel E is P1 (0.0<P1<OB) to the optical black value OB is a first pouchwidth D1 and the range within the pouch width D where the value of theinput signal level E is from the optical black value OB to P2 (OB≤P2) isa second pouch width D2. The pouch width D is a range in which the gainG of the input signal level E is constant.

The gradation correction unit 201 executes negative gradation correctionfor input signal levels E in the interval SC24 of 0.0 to P1, or in otherwords, executes negative offset 1/γ correction, executes gradationcorrection with a constant gain G for input signal levels E in theinterval of the pouch width D, and executes positive gradationcorrection for input signal levels E in the interval of P2 or greater,or in other words, executes positive offset 1/γ correction.

Specifically, for example, in the input-output characteristic curve2400, a waveform 2401 in the interval SC24 is a waveform attained fromnegative offset 1/γ correction, a waveform 2402 in the interval of thepouch width D is a waveform attained from gradation correction in whichthe gain G is constant, and a waveform 2403 of the interval where theinput signal level E is P2 or greater is a waveform attained frompositive offset 1/γ correction.

The gradation correction algorithm shown in the input-outputcharacteristic curve 2400 of FIG. 24 is represented by the followingformula (17).

E′=OETF[E]=OUT[1]−C×{(IN[1]−E+K)^(1/γ) −K ^(1/γ) } E<IN[1]

OUT[1]+C×g×(E−IN[1]) IN[1]≤E<IN[2]

OUT[2]+C×{(E−IN[2]+K)^(1/γ) −K ^(1/γ)} IN[2]  (17)

where K=(g×γ)^(γ/(1−γ))

C=1/{(IN[1]+K)^(1/γ)(1−IN[2]+K)^(1/γ)−2K ^(1/γ) −g×(P1+P2)}

IN[1]=OB−P1

IN[2]=OB+P2

OUT[1]=C×{(IN[1]+K)^(1/γ) −K ^(1/γ)}

OUT[2]=OUT[1]+C×g×(P1+P2)

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, γ is the gammavalue, and g is the calculated provisional gain. Also, IN[1] is thefirst pouch width D1 and IN[2] is the second pouch width D2.

In formula (17), the formula for when the condition is E<OB is theformula for negative offset 1/γ correction, the formula for when thecondition is IN[1]≤E<IN[2], or in other words, the pouch width Dsignifies gradation correction in which the gain G is constant, and theformula for when the condition is IN[2]≤E is the formula for positiveoffset 1/γ correction. The gradation correction unit 201 outputs thegradation correction identifier 326 indicating the gradation correctionalgorithm of formula (17) to the encoding unit 202, and the encodingunit 202 uses the gradation correction identifier 326 from the gradationcorrection unit 201 as the control information 312 in the headerinformation 301.

FIG. 25 is a graph showing gain characteristics under input-opticalcharacteristics 5 for gradation correction when an optical black valueis used. A gain characteristic curve 2500 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (18), which is the derivative of formula (17).

G={OETF[E]}′=(C/γ)×(IN[1]−E+K)^((1/γ)−1) E<IN[1]

C×g IN[1]≤E<IN[2]

(C/γ)×(E−IN[2]+K)^((1/γ)−1) IN[2]≤E   (18)

G is the gain of the input signal level E. Specifically, in the gaincharacteristic curve 2500, for example, the gain G takes on the minimumvalue when the input signal level E is at 0.0 in the interval SC24,increases from 0.0, and reaches the calculated provisional gain g, whichis the maximum value, at P1, which is the right hand edge of the pouchwidth D. The calculated provisional gain g is a value set by the settingunit 204.

The gain G is held constant at the calculated provisional gain g in thepouch width D. The gain G decreases from the optical black value OB atP2, which is the left hand edge of the pouch width D, or greater. As aresult of setting the first pouch width D1, it is possible to preservenoise in the vicinity of the optical black value OB. Also, as a resultof setting the second pouch width D2, it is possible to increase thedegree to which black is expressed, the higher the compression rate is.

Also, the second pouch width D2 is variable according to the exposureamount set by the setting unit 204. Specifically, the optical blackvalue OB is fixed and the position of P2 is changed. By setting theexposure amount to be an underexposure in the setting unit 204, P2 ischanged such that the input signal level E increases, and the secondpouch width P2 is widened, for example.

On the other hand, by setting the exposure amount to be an overexposurein the setting unit s204, P2 is changed such that the input signal levelE decreases, and the second pouch width P2 is narrowed. In this manner,it is possible to expand or shrink the second pouch width D2 accordingto the exposure amount and emphasize pixels in the vicinity of theoptical black value according to the exposure amount.

FIG. 26 is a graph showing input-output characteristics 5 for inversegradation correction when an optical black value is used. The inversegradation correction unit 603 executes positive inverse gradationcorrection for values of OUT[2] or greater for a given input signallevel E′ of the gradation correction RAW image data, or in other words,executes positive offset γ correction, performs inverse gradationcorrection in which the gain G is constant for values of OUT[1] orgreater and less than OUT[2], and executes negative gradation correctionfor input signal levels lower than OUT[1], or in other words, executesnegative offset γ correction.

An interval SC261 is an interval where the input signal level E′ is from0.0 to OUT[1] indicated in formula (16), an interval SC262 is aninterval where the input signal level E′ is from OUT[1] to OUT[2], andan interval SC263 is an interval where the input signal level E′ is fromOUT[2] to 1.0.

Specifically, for example, in the input-output characteristic curve2600, a waveform 2601 in the interval SC261 is a waveform attained fromnegative offset γ correction, a waveform 2602 of the interval SC262 is awaveform attained from inverse gradation correction in which the gain Gis constant, and a waveform 2603 of the interval SC263 is a waveformattained from positive offset γ correction.

The inverse gradation correction algorithm shown in the input-outputcharacteristic curve 2600 of FIG. 26 is represented by the followingformula (19).

E=EOTF[E′]=IN[1]+K−{(OUT[1]−E′)/C+K ^(1/γ)}^(γ) E′<OUT[1]

IN[1]+(E′−OUT[1])/(C×g) OUT[1]≤E<OUT[2]

IN[2]−K+{(E′−OUT[2])/C+K ^(1/γ)}^(γ) OUT[2]≤E′  (19)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. In formula (19), the formula for when thecondition is E′<OUT[1] is the formula for negative offset γ correction,the formula for when the condition is In[1]≤E<In[2] signifies inversegradation correction in which the gain G is constant, and the formulafor when the condition is OUT[2]≤E′ is the formula for positive offset γcorrection. The inverse gradation correction unit 603 executes theinverse gradation correction of formula (19) if the gradation correctionidentifier 326 indicating formula (17) is detected in the controlinformation 312.

By executing negative offset γ correction in the interval SC261, it ispossible to improve color reproduction in the vicinity of the opticalblack value OB in the RAW image data that has undergone inversegradation correction. Also, the gain of the bright portions isincreased, and thus, it is possible to emphasize pixels that are in thebright portion as a result of gradation correction.

Embodiment 5

Embodiment 5 shows an example in which the positive slope of theinterval in the input-output characteristic curve where the input signallevel E is from 0 to OB is constant. In Embodiment 5, differences fromEmbodiment 3 will be primarily described, and descriptions of the sameconfigurations and content as Embodiment 3 are applicable to Embodiment5 as well, and descriptions thereof are omitted.

FIG. 27 is a graph showing input-output characteristics 6 for gradationcorrection when an optical black value is used. In the input-outputcharacteristic example 6 of gradation correction when using the opticalblack value, the gradation correction unit 201 executes gradationcorrection in which the positive slope is constant for input signallevels E lower than the optical black value OB, and executes positivegradation correction for input signal levels E greater than or equal tothe optical black value OB, or in other words, executes positive offset1/γ correction.

Specifically, in the input-output characteristic curve 2700, forexample, the waveform 2701 of the interval SC9 is a linear waveform inwhich the output signal level E′ increases as the input signal level Eincreases. In other words, in the interval SC9, the input signal level Eis directly proportional to the output signal level E′. The waveform2702 of the interval SC27 (OB≤E) greater than or equal to the opticalblack value OB is a waveform attained from positive offset 1/γcorrection. The gradation correction unit 201 performs fitting bygradation correction such that the output signal level E′ is 1.0 whenthe input signal level E is 1.0.

The gradation correction algorithm shown in the input-outputcharacteristic curve 2700 of FIG. 27 is represented by the followingformula (20).

E′=OETF[E]=E×S E<OB

β+α×(E−OB)^(1/γ) OB≤E   (20)

where α=(1−OB×S)/(1−OB)^(1/γ)

β=OB×S

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, and γ is the gammavalue. S is a constant value indicating the slope of the waveform 2701of the interval SC9. The slope S is equal to 4 in FIG. 27, for example.The slope S may be any positive value. α is a fitting coefficient thatcan be adjusted by the setting unit 204. Specifically, for example, thesetting unit 204 can adjust the fitting coefficient α according tofluctuations in the ISO sensitivity in the information processingapparatus 100.

In formula (20), the formula for when the condition is E<OB is theformula for gradation correction in which the positive slope is constantfor the input signal level E, and the formula for when the condition isOB≤E is the formula for positive offset 1/γ correction. The gradationcorrection unit 201 outputs the gradation correction identifier 326indicating the gradation correction algorithm of formula (20) to theencoding unit 202, and the encoding unit 202 uses the gradationcorrection identifier 326 from the gradation correction unit 201 as thecontrol information 312 in the header information 301.

FIG. 28 is a graph showing gain characteristics under input-opticalcharacteristics 6 for gradation correction when an optical black valueis used. A gain characteristic curve 2800 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (21), which is the derivative of formula (20).

G={OETF[E]}′=S E<OB

(α/γ)×(E−OB)^(1/(γ−1)) OB≤E   (21)

G is the gain of the input signal level E. Specifically, in the gaincharacteristic curve 2800, for example, the gain G takes on a constantvalue in the interval SC9.

Also, similar to Embodiment 1, by setting the gain G of the dark portionto be large during gradation correction, distortion of dark portionsoccurring between the encoding unit 202 and the decoding unit 602 can besuppressed. As a result, during developing or image adjustment, even ifdark portions are brightened to allow for greater visibility of figuresin dark portions or the like, distortion of dark portions has less of atendency to be prominent.

FIG. 29 is a graph showing input-output characteristics 6 for inversegradation correction when an optical black value is used. The inversegradation correction unit 603 executes inverse gradation correction suchthat the positive slope is constant for input signal levels E′ lowerthan the optical black value OB, and executes negative inverse gradationcorrection for input signal levels E′ lower than β, or in other words,executes negative γ correction.

An interval SC291 is an interval where the input signal level E′ is from0.0 to β indicated in formula (10), and an interval SC292 is an intervalwhere the input signal level E′ is from β to 1.0. Specifically, forexample, in the input-output characteristic curve 2900, a waveform 2901in the interval SC291 is a waveform attained from inverse gradationcorrection such the positive slope is constant, and a waveform 2902 ofthe interval SC292 is a waveform attained from positive γ correction.

The inverse gradation correction algorithm shown in the input-outputcharacteristic curve 2900 of FIG. 29 is represented by the followingformula (22).

E=EOTF[E′]=E′/S E′<β

OB+(1/α+(E′−β))^(γ) β≤E′  (22)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. In formula (22), the formula for when thecondition is E′<β is the formula for inverse gradation correction inwhich the positive slope is constant for input signal levels E lowerthan the optical black value OB, and the formula for when the conditionis β≤E′ is the formula for positive γ correction. The inverse gradationcorrection unit 603 executes the inverse gradation correction of formula(22) if the gradation correction identifier 326 indicating formula (20)is detected in the control information 312.

By executing inverse gradation correction such that the positive slopeis constant in the interval SC201, it is possible to increase the effectof mitigating encoding distortion in the vicinity of the optical blackvalue OB in the restored RAW image data that has undergone inversegradation correction, and it is possible to reduce noise occurring inthe dark portions, and thus, it is possible to improve colorreproduction.

Embodiment 6

Embodiment 6 shows an example in which two fitting coefficients areadopted in the configuration of Embodiment 5. Specifically, for example,in Embodiment 5, in an interval of the input-output characteristic curve2700 where the input signal level E is greater than or equal to OB(OB≤E), the fitting coefficient a is adjustable. In Embodiment 6,different fitting coefficients are used for the interval SC9 in whichthe input signal level E is less than OB (E<OB) and the interval inwhich the input signal level E is greater than or equal to OB (OB≤E). InEmbodiment 6, differences from Embodiment 5 will be primarily described,and descriptions of the same configurations and content as Embodiment 5are applicable to Embodiment 6 as well, and descriptions thereof areomitted.

FIG. 30 is a graph showing input-output characteristics 7 for gradationcorrection when an optical black value is used. In the input-outputcharacteristic example 7 of gradation correction when using the opticalblack value, similar to the input-output characteristic example 6, thegradation correction unit 201 executes gradation correction in which thepositive slope is constant for input signal levels E lower than theoptical black value OB, and executes positive gradation correction forinput signal levels E greater than or equal to the optical black valueOB, or in other words, executes positive offset 1/γ correction.

Specifically, for example, in the input-output characteristic curve3000, a waveform 3001 in the interval SC9 is a linear waveform in whichthe output signal level E′ increases as the input signal level Eincreases, and a waveform 3002 of the interval greater than or equal tothe optical black value OB is a waveform attained from positive offset1/γ correction. The gradation correction unit 201 performs fitting bygradation correction such that the output signal level E′ is 1.0 whenthe input signal level E is 1.0.

The gradation correction algorithm shown in the input-outputcharacteristic curve 3000 of FIG. 30 is represented by the followingformula (23).

E′=OETF[E]=E×α1 E<OB

α2×(E−OB)^(1/γ) +β OB≤E   (23)

where α2=(1−β)(1−OB)^(1/γ)

β=α1×OB ^(1/γ)

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, and γ is the gammavalue. α1 is an adjustable fitting coefficient and indicates a positiveslope of the waveform 3001 of the interval SC9. α1 is equal to 2 in FIG.30, for example. α1 may be any positive value. α2 is a fittingcoefficient differing from α1 but dependent thereon.

The setting unit 204 can adjust the fitting coefficient α according tofluctuations in the ISO sensitivity in the information processingapparatus 100. As a result, it is possible to adjust the input-outputcharacteristic curve 3000 with the fitting coefficient α1 in theinterval SC9, and to adjust the input-output characteristic curve 3000with the fitting coefficient α2 having a different value from thefitting coefficient α1 in the interval SC27 where OB≤E.

In formula (23), the formula for when the condition is E<OB is theformula for gradation correction in which the positive slope is constantfor the input signal level E, and the formula for when the condition isOB≤E is the formula for positive offset 1/γ correction. The gradationcorrection unit 201 outputs the gradation correction identifier 326indicating the gradation correction algorithm of formula (23) to theencoding unit 202, and the encoding unit 202 uses the gradationcorrection identifier 326 from the gradation correction unit 201 as thecontrol information 312 in the header information 301.

FIG. 31 is a graph showing gain characteristics under input-opticalcharacteristics 7 for gradation correction when an optical black valueis used. A gain characteristic curve 3100 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (24), which is the derivative of formula (23).

G={OETF[E]}′=α1 E<OB

(α2/γ)×(E−OB)^(1/(γ−1)) OB≤E   (24)

G is the gain of the input signal level E. Specifically, in the gaincharacteristic curve 3100, for example, the gain G takes on a constantvalue in the interval SC9.

Also, similar to Embodiment 1, by setting the gain G of the dark portionto be large during gradation correction, distortion of dark portionsoccurring between the encoding unit 202 and the decoding unit 602 can besuppressed. As a result, during developing or image adjustment, even ifdark portions are brightened to allow for greater visibility of figuresin dark portions or the like, distortion of dark portions has less of atendency to be prominent.

FIG. 32 is a graph showing input-output characteristics 7 for inversegradation correction when an optical black value is used. The inversegradation correction unit 603 executes inverse gradation correction suchthat the positive slope is constant for input signal levels E lower thanthe optical black value OB, and executes negative inverse gradationcorrection for input signal levels lower than β, or in other words,executes negative γ correction.

An interval SC321 is an interval where the input signal level E′ is from0.0 to β indicated in formula (10), and an interval SC292 is an intervalwhere the input signal level E′ is from β to 1.0. Specifically, forexample, in the input-output characteristic curve 3200, a waveform 3201in the interval SC321 is a waveform attained from negative γ correction,and a waveform 3202 of the interval SC322 is a waveform attained frompositive γ correction.

The inverse gradation correction algorithm shown in the input-outputcharacteristic curve 3200 of FIG. 32 is represented by the followingformula (25).

E=EOTF[E′]/α1 E′<β

OB+(1/α2×(E′−β))^(γ) β≤E′  (25)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. In formula (25), the formula for when thecondition is E′<β is the formula for inverse gradation correction inwhich the positive slope is constant for input signal levels E lowerthan the optical black value OB, and the formula for when the conditionis β≤E′ is the formula for positive γ correction. The inverse gradationcorrection unit 603 executes the inverse gradation correction of formula(25) if the gradation correction identifier 326 indicating formula (23)is detected in the control information 312.

By executing inverse gradation correction such that the positive slopeis constant in the interval SC321, it is possible to increase the effectof mitigating encoding distortion in the vicinity of the optical blackvalue OB in the restored RAW image data that has undergone inversegradation correction, and it is possible to reduce noise occurring inthe dark portions, and thus, it is possible to improve colorreproduction.

Embodiment 7

Embodiment 7 is another example of Embodiment 2 in which an input signallevel E less than or equal to the optical black value OB is replicatedwhile the gain G of the optical black value OB is maximized in themanner of the input-output characteristic example 2 of gradationcorrection for when the optical black value of Embodiment 1 is used. InEmbodiment 7, differences from Embodiment 2 will be primarily described,and descriptions of the same configurations and content as Embodiment 2are applicable to Embodiment 7 as well, and descriptions thereof areomitted.

FIG. 33 is a graph showing input-output characteristics 8 for gradationcorrection when an optical black value is used. In the input-outputcharacteristic example 8 for gradation correction when using the opticalblack value, unlike the input-output characteristic examples 1 and 2 ofgradation correction when using the optical black value, the gradationcorrection unit 201 executes negative gradation correction for inputsignal levels E lower than the optical black value OB, or in otherwords, executes negative 1/γ correction, and executes positive gradationcorrection for input signal levels E greater than or equal to theoptical black value OB, or in other words, executes positive 1/γcorrection.

Specifically, for example, in the input-output characteristic curve3300, a waveform 3301 in the interval SC9 is a waveform attained fromnegative 1/γ correction, and a waveform 3302 of the interval greaterthan or equal to the optical black value OB is a waveform attained frompositive 1/γ correction.

The gradation correction algorithm shown in the input-outputcharacteristic curve 3300 of FIG. 33 is represented by the followingformula (26).

E′=OETF[E]=−(OB−E)^(1/γ) +β E<OB

α×(E−OB)^(1/γ) +β OB≤E   (26)

where α=(1−OB ^(1/γ))/(1−OB)^(1/γ)

β=OB ^(1/γ)

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, γ is the gammavalue, and α is a fitting coefficient that can be adjusted by thesetting unit 204. Specifically, for example, the setting unit 204 canadjust the fitting coefficient α according to fluctuations in the ISOsensitivity in the information processing apparatus 100.

In formula (26), the formula for when the condition is E<OB is theformula for negative 1/γ correction, and the formula for when thecondition is OB≤E is the formula for positive 1/γ correction. Thegradation correction unit 201 outputs the gradation correctionidentifier 326 indicating the gradation correction algorithm of formula(26) to the encoding unit 202, and the encoding unit 202 uses thegradation correction identifier 326 from the gradation correction unit201 as the control information 312 in the header information 301.

By executing negative 1/γ correction in the interval SC9, it is possibleto improve color reproduction in the vicinity of the optical black valueOB in the RAW image data that has undergone gradation correction. Inother words, in the portion of the input-output characteristic curve3300 in the vicinity of the optical black value OB, noise on the sidewhere the input signal level E is less than the optical black value OB(negative direction) and noise on the side where the input signal levelE is greater than the optical black value OB (positive direction) canceleach other out in a noise reduction process, which allows for moreefficient noise reduction than in Embodiment 1. Thus, it is possible tomitigate black level degradation in the vicinity of the optical blackvalue OB in the RAW image data that has undergone gradation correction,and improve color reproduction.

FIG. 34 is a graph showing gain characteristics under input-opticalcharacteristics 8 for gradation correction when an optical black valueis used. A gain characteristic curve 3400 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (27), which is the derivative of formula (26).

G={OETF[E]}′=(1/γ)×(OB−E)^(1/(γ−1)) E<OB

(α/γ)×(E−OB)^(1/(γ−1)) OB≤E   (27)

where α=(1−OB ^(1/γ))/(1−OB)^(1/γ)

G is the gain of the input signal level E. Specifically, in the gaincharacteristic curve 3400, for example, the gain G takes on the minimumvalue when the input signal level E is at 0.0 in the interval SC9,increases from 0.0, and reaches the maximum value (infinity) when theinput signal level E reaches the optical black value OB.

Also, by setting the gain G of the dark portion to be large duringgradation correction, distortion of dark portions occurring between theencoding unit 202 and the decoding unit 602 can be suppressed. As aresult, during developing or image adjustment, even if dark portions arebrightened to allow for greater visibility of figures in dark portionsor the like, distortion of dark portions has less of a tendency to beprominent.

FIG. 35 is a graph showing input-output characteristics 8 for inversegradation correction when an optical black value is used. The inversegradation correction unit 603 executes positive inverse gradationcorrection for a value greater than or equal to β for a given inputsignal level E′ of the gradation correction RAW image data, or in otherwords, executes positive γ correction, and executes negative inversegradation correction for input signal levels less than β, or in otherwords, executes negative γ correction.

An interval SC351 is an interval where the input signal level E′ is from0.0 to β indicated in formula (10), and an interval SC352 is an intervalwhere the input signal level E′ is from β to 1.0. Specifically, forexample, in the input-output characteristic curve 3500, a waveform 3501in the interval SC351 is a waveform attained from negative γ correction,and a waveform 3502 of the interval SC352 is a waveform attained frompositive γ correction.

The inverse gradation correction algorithm shown in the input-outputcharacteristic curve 3500 of FIG. 35 is represented by the followingformula (28).

E=EOTF[E′]=OB−(β−E′)^(γ) E′<β

OB+{1/α×(E′−β)}^(γ) β≤E′  (28)

where α=(1−OB ^(1/γ))/(1−OB)^(1/γ)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. In formula (28), the formula for when thecondition is E′<β is the formula for negative γ correction, and theformula for when the condition is β≤E′ is the formula for positive γcorrection. The inverse gradation correction unit 603 executes theinverse gradation correction of formula (28) if the gradation correctionidentifier 326 indicating formula (26) is detected in the controlinformation 312.

By executing negative γ correction in the interval SC351, it is possibleto increase the effect of mitigating encoding distortion in the vicinityof the optical black value OB in the restored RAW image data that hasundergone inverse gradation correction, and it is possible to reducenoise occurring in the dark portions, and thus, it is possible toimprove color reproduction.

Embodiment 8

Embodiment 8 shows an example in which two fitting coefficients areadopted in the configuration of Embodiment 7. Specifically, for example,in Embodiment 7, in an interval SC27 of the input-output characteristiccurve 3300 where the input signal level E is greater than or equal to OB(OB≤E), the fitting coefficient a is adjustable. In Embodiment 8,different fitting coefficients are used for the interval SC9 in whichthe input signal level E is less than OB (E<OB) and the interval SC27 inwhich the input signal level E is greater than or equal to OB (OB≤E). InEmbodiment 8, differences from Embodiment 7 will be primarily described,and descriptions of the same configurations and content as Embodiment 7are applicable to Embodiment 8 as well, and descriptions thereof areomitted.

FIG. 36 is a graph showing input-output characteristics 9 for gradationcorrection when an optical black value is used. In the input-outputcharacteristic example 9 of gradation correction when using the opticalblack value, like the input-output characteristic example 8 and unlikethe input-output characteristic examples 1 and 2 of gradation correctionwhen using the optical black value, the gradation correction unit 201executes negative gradation correction for input signal levels E lowerthan the optical black value OB, or in other words, executes negative1/γ correction, and executes positive gradation correction for inputsignal levels E greater than or equal to the optical black value OB, orin other words, executes positive 1/γ correction.

Specifically, for example, in the input-output characteristic curve3600, a waveform 3601 in the interval SC9 is a waveform attained fromnegative 1/γ correction, and a waveform 3602 of the interval SC27greater than or equal to the optical black value OB is a waveformattained from positive 1/γ correction.

The gradation correction algorithm shown in the input-outputcharacteristic curve 3600 of FIG. 36 is represented by the followingformula (29).

E′=OETF[E]=−α1×(OB−E)^(1/γ) +β E<OB

α2×(E−OB)^(1/γ) +β OB≤E   (29)

where α2=(1−β)/(1−OB)^(1/γ)

β=α1×OB ^(1/γ)

E represents the signal level of the RAW image data (input signallevel), E′ represents the signal level of the gradation correction RAWimage data (output signal level), OETF[ ] represents a gradationcorrection function, OB is the optical black value, γ is the gammavalue, and α1 and α2 are adjustable fitting coefficients. α2 is afitting coefficient differing from α1 but dependent thereon.

The setting unit 204 can adjust the fitting coefficient a according tofluctuations in the ISO sensitivity in the information processingapparatus 100. As a result, it is possible to adjust the input-outputcharacteristic curve 3600 with the fitting coefficient a 1 in theinterval SC9, and to adjust the input-output characteristic curve 3600with the fitting coefficient α2 having a different value from thefitting coefficient α1 in the interval SC27 where OB≤E.

In formula (29), the formula for when the condition is E<OB is theformula for negative 1/γ correction, and the formula for when thecondition is OB≤E is the formula for positive 1/γ correction. Thegradation correction unit 201 outputs the gradation correctionidentifier 326 indicating the gradation correction algorithm of formula(29) to the encoding unit 202, and the encoding unit 202 uses thegradation correction identifier 326 from the gradation correction unit201 as the control information 312 in the header information 301.

By executing negative 1/γ correction in the interval SC9, it is possibleto improve color reproduction in the vicinity of the optical black valueOB in the RAW image data that has undergone gradation correction. Inother words, in the portion of the input-output characteristic curve3600 in the vicinity of the optical black value OB, noise on the sidewhere the input signal level E is less than the optical black value OB(negative direction) and noise on the side where the input signal levelE is greater than the optical black value OB (positive direction) canceleach other out in a noise reduction process, which allows for moreefficient noise reduction than in Embodiment 1. Thus, it is possible tomitigate black level degradation in the vicinity of the optical blackvalue OB in the RAW image data that has undergone gradation correction,and improve color reproduction.

FIG. 37 is a graph showing gain characteristics under input-opticalcharacteristics 9 for gradation correction when an optical black valueis used. A gain characteristic curve 3700 at an input signal level E forgradation correction when an optical black value is used is representedby the following formula (30), which is the derivative of formula (29).

G={OETF[E]}′=(α1/γ)×(OB−E)^(1/(γ−1)) E<OB

(α2/γ)×(E−OB)^(1/(γ−1)) OB≤E   (30)

where α2=(1−β)/(1−OB)^(1/γ)

β=α1×OB ^(1/γ)

G is the gain of the input signal level E. Specifically, in the gaincharacteristic curve 3700, for example, the gain G takes on the minimumvalue when the input signal level E is at 0.0 in the interval SC9,increases from 0.0, and reaches the maximum value (infinity) when theinput signal level E reaches the optical black value OB.

Also, by setting the gain G of the dark portion to be large duringgradation correction, distortion of dark portions occurring between theencoding unit 202 and the decoding unit 602 can be suppressed. As aresult, during developing or image adjustment, even if dark portions arebrightened to allow for greater visibility of figures in dark portionsor the like, distortion of dark portions has less of a tendency to beprominent.

FIG. 38 is a graph showing input-output characteristics 9 for inversegradation correction when an optical black value is used. The inversegradation correction unit 603 executes positive inverse gradationcorrection for a value greater than or equal to β for a given inputsignal level E′ of the gradation correction RAW image data, or in otherwords, executes positive γ correction, and executes negative inversegradation correction for input signal levels less than β, or in otherwords, executes negative γ correction.

An interval SC381 is an interval where the input signal level E′ is from0.0 to β indicated in formula (10), and an interval SC382 is an intervalwhere the input signal level E′ is from β to 1.0. Specifically, forexample, in the input-output characteristic curve 3800, a waveform 3801in the interval SC381 is a waveform attained from negative γ correction,and a waveform 3802 of the interval SC382 is a waveform attained frompositive γ correction.

The inverse gradation correction algorithm shown in the input-outputcharacteristic curve 3800 of FIG. 38 is represented by the followingformula (31).

E=EOTF[E′]={1/α1×(β−E′)}^(γ) E′<β

OB+{1/α2×(E′−β)}^(γ) β≤E′  (31)

where α2=(1−β)/(1−OB)^(1/γ)

β=α1×OB ^(1/γ)

E′ represents the signal level of the gradation correction RAW imagedata (input signal level), E represents the signal level of the restoredRAW image data (output signal level), and EOTF[ ] represents an inversegradation correction function. In formula (31), the formula for when thecondition is E′<β is the formula for negative γ correction, and theformula for when the condition is β≤E′ is the formula for positive γcorrection. The inverse gradation correction unit 603 executes theinverse gradation correction of formula (31) if the gradation correctionidentifier 326 indicating formula (29) is detected in the controlinformation 312.

By executing negative γ correction in the interval SC381, it is possibleto increase the effect of mitigating encoding distortion in the vicinityof the optical black value OB in the restored RAW image data that hasundergone inverse gradation correction, and it is possible to reducenoise occurring in the dark portions, and thus, it is possible toimprove color reproduction.

As described above, according to the present embodiment, it is possibleto mitigate encoding distortion of dark portions resulting fromgradation correction. Also, if displaying dark portions to be brighterfor a reason such as greater visibility of forms in the dark portionswhen developing or performing image adjustment, for example, distortionof dark portions occurring between the encoding unit 202 and thedecoding unit 602 can be suppressed by setting the gain G of the darkportion to be large during gradation correction. As a result, duringdeveloping or image adjustment, even if dark portions are brightened toallow for greater visibility of figures in dark portions or the like,distortion of dark portions has less of a tendency to be prominent.Also, it is possible to restore the original RAW image data throughinverse gradation correction.

DESCRIPTION OF THE REFERENCE NUMERALS

-   100 an information processing apparatus, 153 an image capture    element, 161 an active pixel area, 162 an optical black pixel area,    200 an encoder, 201 a gradation correction unit, 202 an encoding    unit, 203 a recording unit, 204 a setting unit, 312 control    information, 326 a gradation correction identifier, 600 a decoder,    601 an acquisition unit, 602 a decoding unit, 603 an inverse    gradation correction unit

What is claimed is:
 1. An encoder, comprising: a correction unitconfigured to execute gradation correction on RAW image data from animage capture element having optical black on the basis of a gammacoefficient and an optical black value of the optical black; and anencoding unit configured to encode gradation correction RAW image datathat has undergone gradation correction by the correction unit, whereinthe correction unit is configured to execute first gradation correctionfor a first interval in which the input signal level of the RAW imagedata is less than the optical black value, and executes second gradationcorrection for a second interval in which the input signal level of theRAW image data is in at least a portion of a range from the opticalblack value to a maximum value.
 2. The encoder according to claim 1,wherein the correction unit is configured to execute, as the firstgradation correction, negative gradation correction on the RAW imagedata in the first interval on the basis of the gamma coefficient and theoptical black value, and execute, as the second gradation correction,positive gradation correction on the RAW image data in the secondinterval on the basis of the gamma coefficient and the optical blackvalue.
 3. The encoder according to claim 2, wherein the correction unitis configured to execute, as the first gradation correction, gradationcorrection on the RAW image data in the first interval on the basis ofgain characteristics in which a gain indicating a degree of emphasis ofthe input signal level increases the closer a value of the input signallevel is to the optical black value.
 4. The encoder according to claim1, wherein the correction unit is configured to execute, as the firstgradation correction, gradation correction on the RAW image data in thefirst interval on the basis of gain characteristics in which a gainindicating a degree of emphasis of the input signal level in the firstinterval is constant, and execute, as the second gradation correction,positive gradation correction on the RAW image data in the secondinterval on the basis of the gamma coefficient and the optical blackvalue.
 5. The encoder according to claim 1, wherein the correction unitis configured to execute third gradation correction in a third intervalthat is between the first interval and the second interval, and thatincludes an input signal level of the optical black value.
 6. Theencoder according to claim 5, wherein the correction unit is configuredto execute, as the third gradation correction, gradation correction onthe RAW image data in the third interval on the basis of gaincharacteristics in which a gain indicating a degree of emphasis of theinput signal level in the third interval is constant.
 7. The encoderaccording to claim 6, wherein the gain is a provisional gain set to theinput signal level of the optical black value.
 8. The encoder accordingto claim 6, wherein the correction unit is configured to execute, as thefirst gradation correction, negative gradation correction on the RAWimage data in the first interval on the basis of the gamma coefficientand the optical black value, and execute, as the second gradationcorrection, positive gradation correction on the RAW image data in thesecond interval on the basis of the gamma coefficient and the opticalblack value.
 9. The encoder according to claim 5, further comprising: asetting unit configured to set a width of the third interval on thebasis of an exposure amount.
 10. The encoder according to claim 1,wherein the encoding unit is configured to output data including encodeddata resulting from the encoding unit encoding the gradation correctionRAW image data, and control information including at least one of thegamma coefficient, the optical black value, or an identifier thatidentifies a type of gradation correction executed by the correctionunit.
 11. The encoder according to claim 5, wherein the encoding unit isconfigured to output data including control information that includesinformation of the gain of the third interval.
 12. The encoder accordingto claim 5, wherein the encoding unit is configured to output dataincluding control information that includes information indicating arange of the third interval.
 13. The encoder according to claim 12,wherein the encoding unit outputs, as information indicating a range ofinput signal levels of the third interval, data including controlinformation that includes the optical black value, a first width that isa range from a minimum value of the third interval to the optical blackvalue, and a second width that is a width from the optical black valueto a maximum value of the third interval.
 14. A decoder, comprising: anacquisition unit configured to acquire encoded RAW image data resultingfrom encoding gradation correction RAW image data that has undergonegradation correction on the basis of a gamma coefficient and an opticalblack value; a decoding unit configured to decode the encoded RAW imagedata acquired by the acquisition unit into the gradation correction RAWimage data; and an inverse gradation correction unit configured toexecute inverse gradation correction on the gradation correction RAWimage data decoded by the decoding unit on the basis of the gammacoefficient and the optical black value, and output the RAW image dataprior to gradation correction, wherein the inverse correction unit isconfigured to execute first inverse gradation correction for a firstinterval in which the input signal level of the gradation correction RAWimage data is less than a prescribed value, and execute second inversegradation correction for a second interval in which the input signallevel of the RAW image data is in at least a portion of a range from theprescribed value to a maximum value.
 15. The decoder according to claim14, wherein the acquisition unit is configured to acquire controlinformation including at least one of the gamma coefficient, the opticalblack value, or an identifier identifying a type of inverse gradationcorrection to be executed by the inverse correction unit, and whereinthe inverse correction unit is configured to execute inverse gradationcorrection on the gradation correction RAW image data on the basis ofthe control information.
 16. The decoder according to claim 14, whereinthe inverse correction unit is configured to execute, as the firstinverse gradation correction, negative inverse gradation correction onthe gradation correction RAW image data in the first interval on thebasis of the gamma coefficient and the optical black value, and execute,as the second inverse gradation correction, positive inverse gradationcorrection on the gradation correction RAW image data in the secondinterval.
 17. The decoder according to claim 14, wherein the inversecorrection unit is configured to execute, as the first inverse gradationcorrection, inverse gradation correction on the gradation correction RAWimage data in the first interval on the basis of gain characteristics inwhich a gain of an output signal level in relation to the input signallevel is constant, and execute, as the second inverse gradationcorrection, positive inverse gradation correction on the gradationcorrection RAW image data in the second interval on the basis of thegamma coefficient and the optical black value.
 18. The decoder accordingto claim 14, wherein the inverse correction unit is configured toexecute third inverse gradation correction in a third interval that isbetween the first interval and the second interval, and that includes aprescribed input signal level.
 19. The decoder according to claim 18,wherein the inverse correction unit is configured to execute, as thethird inverse gradation correction, inverse gradation correction on thegradation correction RAW image data in the third interval on the basisof gain characteristics in which a gain of an output signal level inrelation to the input signal level is constant.
 20. The decoderaccording to claim 19, wherein the acquisition unit is configured toacquire control information that includes information of the gain, andwherein the inverse correction unit is configured to execute inversegradation correction on the gradation correction RAW image data in thethird interval on the basis of the information of the gain.
 21. Thedecoder according to claim 18, wherein the acquisition unit isconfigured to acquire data including control information that includesinformation indicating a range of the third interval, and wherein theinverse correction unit is configured to execute inverse gradationcorrection on the gradation correction RAW image data in the thirdinterval on the basis of the control information.
 22. The decoderaccording to claim 21, wherein the acquisition unit is configured toacquire, as information indicating a range of input signal levels of thethird interval, data including control information that includes theoptical black value, a first width that is a range from a minimum valueof the third interval to the optical black value, and a second widththat is a width from the optical black value to a maximum value of thethird interval, and wherein the inverse correction unit is configured toexecute inverse gradation correction on the gradation correction RAWimage data in the third interval on the basis of the controlinformation.
 23. An encoding method, comprising: a correction process ofexecuting gradation correction on RAW image data from an image captureelement having optical black on the basis of a gamma coefficient and anoptical black value of the optical black; and an encoding process ofencoding gradation correction RAW image data that has undergonegradation correction by the correction process, wherein the correctionprocess executes first gradation correction for a first interval inwhich the input signal level of the RAW image data is less than theoptical black value, and executes second gradation correction for asecond interval in which the input signal level of the RAW image data isin at least a portion of a range from the optical black value to amaximum value.
 24. A decoding method, comprising: an acquisition processof acquiring encoded RAW image data resulting from encoding gradationcorrection RAW image data that has undergone gradation correction on thebasis of a gamma coefficient and an optical black value; a decodingprocess of decoding the encoded RAW image data acquired by theacquisition process into the gradation correction RAW image data; and aninverse gradation correction process of executing inverse gradationcorrection on the gradation correction RAW image data decoded by thedecoding process on the basis of the gamma coefficient and the opticalblack value, and outputting the RAW image data prior to gradationcorrection. wherein the inverse correction process executes firstinverse gradation correction for a first interval in which the inputsignal level of the gradation correction RAW image data is less than aprescribed value, and executes second inverse gradation correction for asecond interval in which the input signal level of the RAW image data isin at least a portion of a range from the prescribed value to a maximumvalue.
 25. A non-transitory recording medium having recorded therein anencoding program that causes a processor to execute the encoding methodaccording to claim
 23. 26. A non-transitory recording medium havingrecorded therein a decoding program that causes a processor to executethe decoding method according to claim 24.